package com.mdx.tools.util.exception;

import lombok.extern.slf4j.Slf4j;

/**
 * @author : jiagang
 * @date : Created in 2022/2/9 10:52
 */
@Slf4j
public class BusinessException extends RuntimeException{
    private static final long serialVersionUID = 1L;

    protected final String message;

    protected Object data;

    public BusinessException(String message)
    {
        this.message = message;
    }

    public BusinessException(String message,Object data)
    {
        this.message = message;
        this.data=data;
    }

    public BusinessException(String message, Throwable e)
    {
        super(message, e);
        this.message = message;
    }

    public BusinessException(String message, Object data,Throwable e)
    {
        super(message, e);
        this.data=data;
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    @Override
    public String getMessage()
    {
        return message;
    }
}
